package com.honghu.villagepost.entity;


import android.os.Parcel;
import android.os.Parcelable;

public class Version implements Parcelable {

    /**
     * 版本号
     */
    public int version;

    /**
     * 版本名
     */
    public String versionName;

    /**
     * 更新内容
     */
    public String updateContent;

    /**
     * 下载地址
     */
    public String androidDownloadUrl;

    /**
     * 是否强制更新
     */
    public boolean forceUpdate;

    protected Version(Parcel in) {
        version = in.readInt();
        versionName = in.readString();
        updateContent = in.readString();
        androidDownloadUrl = in.readString();
        forceUpdate = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(version);
        dest.writeString(versionName);
        dest.writeString(updateContent);
        dest.writeString(androidDownloadUrl);
        dest.writeByte((byte) (forceUpdate ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Version> CREATOR = new Creator<Version>() {
        @Override
        public Version createFromParcel(Parcel in) {
            return new Version(in);
        }

        @Override
        public Version[] newArray(int size) {
            return new Version[size];
        }
    };
}
